package cn.aylog.builder;

import cn.aylog.pojo.User;

/**
 * 建造者模式
 */
public class UserBuilder implements Builder<User> {

    private User user;

    public UserBuilder() {
        user = new User();
    }

    public UserBuilder setCardNo(String cardNo) {
        user.setCardNo(cardNo);
        return this;
    }

    public UserBuilder setIdentity(String identity) {
        user.setIdentity(identity);
        return this;
    }

    public UserBuilder setUsername(String username) {
        user.setUsername(username);
        return this;
    }

    public UserBuilder setPassword(String password) {
        user.setPassword(password);
        return this;
    }

    public UserBuilder setPhone(String phone) {
        user.setPhone(phone);
        return this;
    }

    public UserBuilder setBalance(Double balance) {
        user.setBalance(balance);
        return this;
    }

    @Override
    public User builder() {
        return user;
    }
    
}
